package com.wangshouyu.mp.message;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月07日 11:10
 * @description 视频消息
 */
public class VideoMessage extends MediaMessage{

    /**
     * 视频消息的标题
     */
    @XStreamAlias(value = "Title")
    private String title;

    /**
     * 视频消息的描述
     */
    @XStreamAlias(value = "Description")
    private String description;

    /**
     * 封面id
     */
    @SerializedName(value = "thumb_media_id")
    @JsonProperty(value = "thumb_media_id")
    @JSONField(name = "thumb_media_id")
    private String thumbMediaId;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getThumbMediaId() {
        return thumbMediaId;
    }

    public void setThumbMediaId(String thumbMediaId) {
        this.thumbMediaId = thumbMediaId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        VideoMessage that = (VideoMessage) o;
        return Objects.equals(title, that.title) &&
                Objects.equals(description, that.description) &&
                Objects.equals(thumbMediaId, that.thumbMediaId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), title, description, thumbMediaId);
    }

    @Override
    public String toString() {
        return "VideoMessage{" +
                "title='" + title + '\'' +
                ", description='" + description + '\'' +
                ", thumbMediaId='" + thumbMediaId + '\'' +
                '}';
    }
}
